<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div>
        <p>
            <span>小米9 </span><button id="btn">删除</button>
        </p>
    </div>
    <script>
        var res=window.prompt("请输入你的名字")
        console.log(res)
        var btn=document.getElementById("btn");
         /* parentNode -->亲爸 */ 
        btn.onclick=function(){
           var isDelete= window.confirm("你确定删除吗");
           if(isDelete){
               btn.parentNode.style.display="none";
           }
        }
    </script>
</body>
</html>